package server;

/**
 * @Author: Tao Zheng
 * @classNmae: HttpServlet
 * @packageName: server
 * @description:
 * @DATE: 2021/7/13 17:32
 */
public abstract class HttpServlet implements Servlet {

    public abstract void doGet(Request request, Response response);
    public abstract void doPost(Request request, Response response);

    @Override
    public void services(Request request, Response response) throws Exception {
        if ("GET".equalsIgnoreCase(request.getMethod())){
            doGet(request, response);
        }else {
            doPost(request, response);
        }
    }
}
